//
//  DescriptTableViewCell.m
//  HDYS
//
//  Created by qianfeng on 15-4-22.
//  Copyright (c) 2015年 kay. All rights reserved.
//

#import "DescriptTableViewCell.h"

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width

@implementation DescriptTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 20)];
        titleLabel.text = @"商品描述";
        titleLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:titleLabel];
        
        NSString *text = @"这件牛仔裤采用高档舒适的面料，款式新颖，更显档次，显瘦塑身，适合不同风格的美女，穿着季节长，百搭款，性价比高，绝对值得拥有。尺和厘米的转换：[1尺=33.33厘米，1厘米大概是0.03尺]";
        CGSize resize = [text sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(SCREEN_WIDTH - 20, 10000) lineBreakMode:NSLineBreakByWordWrapping];
        
        UILabel *desLabel = [[UILabel alloc] initWithFrame:CGRectMake(titleLabel.frame.origin.x, titleLabel.frame.origin.y + titleLabel.frame.size.height, SCREEN_WIDTH - 20, resize.height)];
        desLabel.numberOfLines = 0;
        desLabel.lineBreakMode = NSLineBreakByCharWrapping;
        desLabel.font = [UIFont systemFontOfSize:13];
        desLabel.text = text;
        [self.contentView addSubview:desLabel];
    }
    return self;
}
@end
